#include "InputProxy.h"
#include "View.h"

InputProxy::InputProxy()
{
}

InputProxy::~InputProxy(void)
{
}

void InputProxy::update()
{
	int k = 0;
	if(keypressed())
	{
		k = readkey();
	}

	/*if(view->menuMode)
	{
		if( ( k >> 8) == KEY_DOWN )
		{
			view->currentMenu->selectNext();
		}
		if( ( k >> 8) == KEY_UP )
		{
			view->currentMenu->selectPrv();
		}
		if( ( k >> 8) == KEY_ENTER )
		{
			view->currentMenu->confirm();
		}
	}
	else
	{
		if(key[KEY_LEFT])
		{
			controller->movePaddleLeft();
		}
		if(key[KEY_RIGHT])
		{
			controller->movePaddleRight();
		}
		if( ( k >> 8) == KEY_P )
		{
			controller->pause();
		}
	}

	if( ( k >> 8) == KEY_ESC )
	{
		controller->endGame();
	}*/
}